<me:UIWTZ x:Class="WPFExcelReport.TWTWV"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                      xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    xmlns:TXT="clr-namespace:WPFExcelReport;assembly=TTXTIND"  
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWTZ.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:BYTE2IMGConverter  x:Key="bm"/>
    </me:UIWTZ.Resources>
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" ></RowDefinition>
            <RowDefinition Height="1*" ></RowDefinition>

        </Grid.RowDefinitions>
        <WrapPanel>
            <Button Content="{Binding Source={Localization:Translate Word=设计}}" Click="WVCommand"/>
        </WrapPanel>
        <DataGrid Grid.Row="1"   AutoGenerateColumns="False"
                        EnableRowVirtualization="False" EnableColumnVirtualization="False"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                              x:Name="dlgMaster"   
                  IsReadOnly="True"
                                 SelectionUnit="Cell" 
                              RowHeight="20">
            <DataGrid.LayoutTransform>
                <TransformGroup>
                    <RotateTransform Angle="180"/>
                    <MatrixTransform Matrix="-1,0,0,1,0,0"/>
                </TransformGroup>
            </DataGrid.LayoutTransform>
            <DataGrid.ColumnHeaderStyle>
                <Style TargetType="{x:Type DataGridColumnHeader}" 
                BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
                    <Setter Property="LayoutTransform">
                        <Setter.Value>
                            <TransformGroup>
                                <RotateTransform Angle="-180"/>
                                <ScaleTransform ScaleX="-1" ScaleY="1" />
                            </TransformGroup>
                        </Setter.Value>
                    </Setter>
                </Style>
            </DataGrid.ColumnHeaderStyle>
            <DataGrid.CellStyle>
                <Style  TargetType="DataGridCell">
                    <Setter Property="LayoutTransform">
                        <Setter.Value>
                            <TransformGroup>
                                <RotateTransform Angle="-180"/>
                                <ScaleTransform ScaleX="-1" ScaleY="1" />
                            </TransformGroup>
                        </Setter.Value>
                    </Setter>
                </Style>
            </DataGrid.CellStyle>

            <DataGrid.Columns>
                <DataGridTemplateColumn x:Name="cDF00" Header="{Binding Source={Localization:Translate Word=1}}">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0000,Converter={StaticResource bm}}" 
                                        MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0000"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF01" Header="{Binding Source={Localization:Translate Word=2}}">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0001,Converter={StaticResource bm}}" 
                                        MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0001"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF02" Header="{Binding Source={Localization:Translate Word=3}}">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0002,Converter={StaticResource bm}}"  
                                        MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0002"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF03" Header="{Binding Source={Localization:Translate Word=4}}">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0003,Converter={StaticResource bm}}" 
                                        MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0003"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF04" Header="{Binding Source={Localization:Translate Word=5}}">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0004,Converter={StaticResource bm}}" 
                                        MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0004"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF05" Header="{Binding Source={Localization:Translate Word=6}}">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0005,Converter={StaticResource bm}}" 
                                        MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0005"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF06" Header="{Binding Source={Localization:Translate Word=7}}">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0006,Converter={StaticResource bm}}" 
                                   MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0006"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF07" Header="{Binding Source={Localization:Translate Word=8}}">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0007,Converter={StaticResource bm}}"   MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0007"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF08" Header="{Binding Source={Localization:Translate Word=9}}"  Visibility="Hidden">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0008,Converter={StaticResource bm}}"   MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0008"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>

                <DataGridTemplateColumn x:Name="cDF09" Header="{Binding Source={Localization:Translate Word=10}}"   Visibility="Hidden">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0009,Converter={StaticResource bm}}"   MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0009"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF10"  Header="{Binding Source={Localization:Translate Word=11}}"  Visibility="Hidden">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0010,Converter={StaticResource bm}}"  MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0010"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF11"  Header="{Binding Source={Localization:Translate Word=12}}"  Visibility="Hidden">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0011,Converter={StaticResource bm}}"   MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0011"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF12"  Header="{Binding Source={Localization:Translate Word=13}}"   Visibility="Hidden">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0012,Converter={StaticResource bm}}"
                                   MouseLeftButtonUp="ByteChgCommand"  
                                   Tag="W0012"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF13"  Header="{Binding Source={Localization:Translate Word=14}}"  Visibility="Hidden">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0013,Converter={StaticResource bm}}"  
                                      MouseLeftButtonUp="ByteChgCommand"
                                   Tag="W0013"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF14"  Header="{Binding Source={Localization:Translate Word=15}}"  Visibility="Hidden">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0014,Converter={StaticResource bm}}"
                                      MouseLeftButtonUp="ByteChgCommand"
                                   Tag="W0014"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF15"  Header="{Binding Source={Localization:Translate Word=16}}" Visibility="Hidden">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0015,Converter={StaticResource bm}}"
                                   MouseLeftButtonUp="ByteChgCommand"
                                   Tag="W0015"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn x:Name="cDF16"  Header="{Binding Source={Localization:Translate Word=17}}"   Visibility="Hidden">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Height="20" Width="24" Source="{Binding Path=W0016,Converter={StaticResource bm}}" 
                                   MouseLeftButtonUp="ByteChgCommand" 
                                   Tag="W0016"
                                   />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>

            </DataGrid.Columns>
        </DataGrid>

    </Grid>
</me:UIWTZ>

    
